package com.aisile.common.exception;

import com.aisile.model.common.enums.AdminHttpCodeEnum;
import com.aisile.model.common.enums.AppHttpCodeEnum;
import com.aisile.model.common.enums.WemediaHttpCodeEnum;

/**
 * @Auther:yry
 * @Date:2023/12/22 0022
 * @VERSON:1.0
 */
public class CustomExceptionCatch {

    // 管理端处理
    public static void catchAdmin(AdminHttpCodeEnum adminHttpCodeEnum){
        throw new CustomException(adminHttpCodeEnum.getCode(),adminHttpCodeEnum.getErrorMessage());
    }

    // app端处理
    public static void catchApp(AppHttpCodeEnum appHttpCodeEnum){
        throw new CustomException(appHttpCodeEnum.getCode(),appHttpCodeEnum.getErrorMessage());
    }

    // 自媒体人处理
    public static void catchWemedia(WemediaHttpCodeEnum wemediaHttpCodeEnum){
        throw new CustomException(wemediaHttpCodeEnum.getCode(),wemediaHttpCodeEnum.getErrorMessage());
    }

}
